home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
manual-p
/
vh-man2h.000
/
vh-man2h
/
vh-man2html-1.3
/
netscape-man
< prev
next >
Wrap
Text File
|
1996-04-25
|
1KB
|
49 lines
#!/bin/sh
#
# Man2hmtl interface to a live (already running) netscape browser.
#
# Michael Hamilton <michael@actrix.gen.nz>, Apr 1996
#
# Usage examples:
# man 1 - section 1 index
# man 3 intro - section 3 name+description index
# man 1 lpr - man page for lpr
# man -k editor - search
#
function nsfunc () {
if ( /bin/ps -xc | grep -q 'netscape$' ) ; then
if [ -x netscape-remote ] ; then
exec netscape-remote -remote "openURL($1,new_window)"
else
exec netscape -remote "openURL($1,new_window)"
fi
else
netscape $1 &
fi
}
if [ $# = 2 ] ; then
case "$1" in
-k)
nsfunc "http:/cgi-bin/mansearch?$2"
;;
*)
if [ $2 = 'intro' ] ; then
nsfunc "http:/cgi-bin/manwhatis?$1"
else
nsfunc "http:/cgi-bin/man2html?$2+$1"
fi
;;
esac
else
case "$1" in
1|2|3|4|5|6|7|8)
nsfunc "http:/cgi-bin/mansec?$1"
;;
*)
nsfunc "http:/cgi-bin/man2html?$1"
;;
esac
fi